package com.stargate.bd.bean;

import java.sql.Date;

public class Affectation {

	public static final String TABLE_NAME = "AFFECTATION";
	public static final String ID_PERSONNE = "Id_Personne";
	public static final String NUM_BADGE = "NumBadge";

	private int idPersonne;
	private int numBadge;
	private Date dateAffectation;
	private Date dateFinAffectation;

	public Affectation(int idPersonne, int numBadge, Date dateAffectation,
			Date dateFinAffectation) {
		this.idPersonne = idPersonne;
		this.numBadge = numBadge;
		this.dateAffectation = dateAffectation == null ? 
				FormatDate.dateSystemSQL() : dateAffectation;
		this.dateFinAffectation = dateFinAffectation;
	}

	public Affectation(int idPersonne, int numBadge) {
		this.idPersonne = idPersonne;
		this.numBadge = numBadge;
		// Date_Affectation = date système par défaut
		dateAffectation = FormatDate.dateSystemSQL();
	}

	public int getIdPersonne() {
		return idPersonne;
	}

	public void setIdPersonne(int idPersonne) {
		this.idPersonne = idPersonne;
	}

	public int getNumBadge() {
		return numBadge;
	}

	public void setNumBadge(int numBadge) {
		this.numBadge = numBadge;
	}

	public Date getDateAffectation() {
		return dateAffectation;
	}

	public void setDateAffectation(Date dateAffectation) {
		this.dateAffectation = dateAffectation;
	}

	public Date getDateFinAffectation() {
		return dateFinAffectation;
	}

	public void setDateFinAffectation(Date dateFinAffectation) {
		this.dateFinAffectation = dateFinAffectation;
	}

	@Override
	public String toString() {
		return "Affectation[" + idPersonne + ", " + numBadge + ", "
				+ dateAffectation + ", " + dateFinAffectation + "]";
	}
}
